#pragma once

#include <glad/glad.h>
#include <GLFW/glfw3.h>





class Mouse
{
private:
    double lastX = 0.0f;
    double lastY = 0.0f;
    bool firstMouse = true;

    double offsetX = 0.0f;
    double offsetY = 0.0f;

  
    GLFWwindow* window;
public:
    Mouse(GLFWwindow* window)
    {
        this->window = window;
    }

    void updata()
    {
        double xpos;
        double ypos;
        glfwGetCursorPos(window, &xpos, &ypos);
        if(firstMouse)
        {
            lastX = xpos;
            lastY = ypos;
            firstMouse = false;
        }
        offsetX = xpos - lastX;
        offsetY =lastY - ypos ;
        lastX = xpos;
        lastY = ypos;
    }

    double GetOffsetX(){return offsetX;};
    double GetOffsetY(){return offsetY;};
};

